package _108ConvertSortedArrayToBinarySearchTree;

public class CSolution {

  public static void main(String[] args) {
    System.out.println("aa");
  }

  private static TreeNode getTree(int[] arrays) {
    if (arrays == null || arrays.length == 0) {
      return null;
    }
    int faster = 0;
    int slower = 0;
    while (faster < arrays.length) {
      faster = faster + 2;
      slower = slower + 1;
    }
    return new TreeNode(arrays[slower]);
  }

  private static TreeNode getOneTreeNode(int[] arrays) {
      if (arrays == null || arrays.length == 0) {
          return null;
      }
      int head = 0;
      int end = arrays.length-1;
      TreeNode root = null;
    root = new TreeNode(arrays[(head+end)/2]);
    while(head<=end) {
        root.left = getRoot(arrays,head,(head+end)/2-1);
        root.left = getRoot(arrays,(head+end)/2+1,end);
      }
      return root;
  }

  private static TreeNode getRoot(int[] arrays,int head,int tail) {
    if(head<=tail) {
      return new TreeNode(arrays[(head+tail)/2]);
    }
  }
}
